// @ts-ignore
/* eslint-disable */
import request from "@/plugins/globalRequest";

/** 新增果蔬 POST /vegetable/addVegetable */
export async function addVegetableUsingPOST(body: API.Vegetable, options?: { [key: string]: any }) {
  return request<API.BaseResultString_>('/vegetable/addVegetable', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除一条果蔬对象 DELETE /vegetable/deleteVegetableById/${param0} */
export async function deleteVegetableByIdUsingDELETE(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteVegetableByIdUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResultString_>(`/vegetable/deleteVegetableById/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 批量删除果蔬 DELETE /vegetable/deleteVegetableList */
export async function deleteVegetableListUsingDELETE(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteVegetableListUsingDELETEParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResultVegetable_>('/vegetable/deleteVegetableList', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 修改果蔬对象 PUT /vegetable/modifyVegetableById */
export async function modifyVegetableByIdUsingPUT(
  body: API.Vegetable,
  options?: { [key: string]: any },
) {
  return request<API.BaseResultVegetable_>('/vegetable/modifyVegetableById', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页查询所有果蔬 GET /vegetable/queryAllVeg */
export async function queryAllUsingGET3(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryAllUsingGET3Params,
  options?: { [key: string]: any },
) {
  return request<API.BaseResultPageQueryCondition_>('/vegetable/queryAllVeg', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 查询一条果蔬 GET /vegetable/queryVegetableById/${param0} */
export async function queryVegetableByIdUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryVegetableByIdUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResultVegetable_>(`/vegetable/queryVegetableById/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}
